/* Copyright (c) 2024 Huawei Technologies Co., Ltd.
openFuyao is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
         http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN 'AS IS' BASIS, WITHOUT WARRANTIES OF ANY KIND,
EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
See the Mulan PSL v2 for more details. */
export const ResponseCode = {
  OK: 200,
  Created: 201,
  Accepted: 202,
  NoContent: 204,
  BadRequest: 400,
  UnAuthorized: 401,
  Forbidden: 403,
  NotFound: 404,
  Conflict: 409,
  InternalServerError: 500,
  BadGateway: 502,
  GatewayTimeout: 504,
};

// 容器平台路由前缀
export const containerRouterPrefix = 'monitoring-dashboard';
export const containerStylePrefix = 'monitoring-dashboard'; // 样式前缀

export const DEFAULT_PAGE_SIZE = 10;
export const DEFAULT_CURRENT_PAGE = 1;

export const stepList = {
  '10m': 2,
  '30m': 6,
  '1h': 14,
  '3h': 72,
  '6h': 86,
  '1d': 345,
  '3d': 1035,
  '7d': 2419,
  '14d': 4838,
}; // 基于prometheus 5min-1s

export const timePeriodOptions = [
  {
    label: '近10分钟',
    value: '10m',
  },
  {
    label: '近30分钟',
    value: '30m',
  },
  {
    label: '近1小时',
    value: '1h',
  },
  {
    label: '近3小时',
    value: '3h',
  },
  {
    label: '近6小时',
    value: '6h',
  },
  {
    label: '近1天',
    value: '1d',
  },
  {
    label: '近3天',
    value: '3d',
  },
  {
    label: '近7天',
    value: '7d',
  },
  {
    label: '近14天',
    value: '14d',
  },
];

export const refreshTimeOptions = [
  {
    label: '不自动刷新',
    value: 0,
  },
  {
    label: '刷新间隔 15s',
    value: 15,
  },
  {
    label: '刷新间隔 30s',
    value: 30,
  },
  {
    label: '刷新间隔 1m',
    value: 60,
  },
  {
    label: '刷新间隔 5m',
    value: 300,
  },
  {
    label: '刷新间隔 1d',
    value: 86400,
  },
];

export const componentTypeOptions = [
  {
    label: '线形图',
    value: 'line',
  },
  {
    label: '堆叠面积图',
    value: 'area',
  },
  {
    label: '数字',
    value: 'number',
  },
  {
    label: '仪表盘',
    value: 'dashboard',
  },
  {
    label: '环图',
    value: 'dount',
  },
  {
    label: '柱状图',
    value: 'bar',
  },
];

export const widgetTypeList = {
  line: '0',
  area: '1',
  number: '2',
  dashboard: '3',
  dount: '4',
  bar: '5',
};
export const reserveWidgetType = {
  0: 'line',
  1: 'area',
  2: 'number',
  3: 'dashboard',
  4: 'dount',
  5: 'bar',
};


// 业务流code
export const BusinessCode = {
  DuplicateName: 403,
};